# 作者：SP
# 开发时间：2025/3/23 18:04
import sys
from PyQt5.QtWidgets import *

class Example(QWidget):
    def __init__(self):
        super().__init__()
        self.initUI()
    def initUI(self):
        self.resize(2000,1000)
        self.setWindowTitle('hello')
        self.button1 = QPushButton('button1',self)
        self.button1.setGeometry(10,20,80,50)
        self.button2 = QPushButton('button2',self)
        self.button2.setGeometry(110,20,80,50)
        self.button1.clicked.connect(self.click)
        self.button2.clicked.connect(self.click)
    def click(self):
        button = self.sender()
        QMessageBox.information(self,'Notice',button.text()+' is cool!',QMessageBox.Yes)
if __name__ == '__main__':
    app = QApplication(sys.argv)
    mywindow = Example()
    mywindow.show()
    sys.exit(app.exec_())